#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

void solve() {
    int n;
    cin >> n;
    vector<int> a(n + 1);
    for(int i = 1; i <= n; i++) cin >> a[i];
    if(a[1] > a[2]){
        cout << "NO" << endl;
        return;
    }
    int res = a[2] - min(a[1], a[2]);
    for(int i = 3; i <= n; i++) {
        if(a[i] >= res) {
            res = a[i] - min(res, a[i]);
        }else{
            cout << "NO" << endl;
            return;
        }
    }
     cout << "YES" << endl;
}

int main() {
    ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
    int t;
    cin >> t;
    while(t--) solve();
    return 0;
}